package com.xyf.sys.domain;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Author R-H
 * @Date 2024/1/231011
 * @Description
 */
@Data
@ApiModel
public class User {

    private String id;

    @JsonProperty("OPENID")
    private String openid;

    private String appid;

    private String unionid;

    private String officialAccountOpenid;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("手机号")
    private String mobile;

    private String sex;

    private String birthday;

    private String realAddress;

    @ApiModelProperty("头像")
    private String avatar;

    @JsonIgnore
    private String regimentId;

    private Long deptId;

    private String code;

    private String country;
    @ApiModelProperty("省")
    private String province;

    @ApiModelProperty("市")
    private String city;

    @ApiModelProperty("区")
    private String area;

    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("经度")
    private BigDecimal longitude;

    @ApiModelProperty("纬度")
    private BigDecimal latitude;

    private String locationName;

    @JsonIgnore
    private String parentId;

    @JsonIgnore
    private String parentIds;

    /**
     *  1 申请中 2 申请通过
     */
    private Integer registStatus;

    private String realId;

    private String realName;

    private String idCardUrl;

    private Long logisticPriceSchemeId;

    private Long dryCleaningPriceSchemeId;

    private String supplierTypeDictIds;

    @ApiModelProperty("取件价格")
    private BigDecimal pickUpPrice;

    private String shortId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastUpdateTime;

    private String createBy;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private String updateBy;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private String remark;

    private BigDecimal distance;

    public BigDecimal getDistance() {
        return distance == null ? null : distance.setScale(2, RoundingMode.HALF_UP);
    }

    public List<Long> roles_;

    public List<Long> logistics_;

    public List<Long> supplierTypeDictIdList;

    private Long defaultSendManAddressId;

    /**
     *  默认收件地址
     */
    private Long defaultRecManAddressId;

    /**
     *  默认寄件地址
     */
    private UserAddress defaultSendManAddress;

    /**
     *  默认收件地址
     */
    private UserAddress defaultRecManAddress;

    private String userId;

    private List<Role> roles;

    private String deptName;

    private Boolean client;

    private List<Long> deptIds;

}
